<?php
$form = $this->beginWidget('CActiveForm', array(
    'id'    => 'myForm',
    'focus' => array($model, 'full_name'),
    'htmlOptions' => array(
        'class' => 'form-inline formDatLk',
    ),
    'errorMessageCssClass' => 'txtError'
));
$modelName = get_class($model) . '_';
?>

    <table class="tableNone">
        <colgroup>
            <col width="100"/>
            <col width="180"/>
            <col/>
            <col width="100"/>
        </colgroup>
        <tbody>
            <tr>
                <td>
                    <?php $attr = 'full_name' ?>
                    <?php echo $form->labelEx($model, $attr) ?>
                </td>
                <td>
                    <div>
                        <?php echo $form->textField($model, $attr, array('style' => 'width: 150px;')) ?>
                    </div>
                </td>
                <td colspan="2">
                    <div>
                        <?php $attr = 'age' ?>
                        <?php echo $form->labelEx($model, $attr, array('style' => 'margin-right: 10px;')) ?>
                        <?php echo $form->textField($model, $attr, array('style' => 'width: 25px;')) ?>

                        <?php $attr = 'sex' ?>
                        <?php echo $form->label($model, $attr, array('style' => 'margin: 0 10px;')) ?>
                        <label class="radio">
                            <?php echo $form->radioButton($model, $attr, array('value' => 'Nam', 'uncheckValue' => null)) ?>
                            Nam
                        </label>
                        <label class="radio" style="margin-left: 10px;">
                            <?php echo $form->radioButton($model, $attr, array('value' => 'Nữ', 'uncheckValue' => null)) ?>
                            Nữ
                        </label>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <?php $attr = 'address' ?>
                    <?php echo $form->labelEx($model, $attr) ?>
                </td>
                <td colspan="3">
                    <div>
                        <?php echo $form->textField($model, $attr, array('style' => 'width: 490px;')) ?>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <?php $attr = 'phone' ?>
                    <?php echo $form->labelEx($model, $attr) ?>
                </td>
                <td>
                    <div>
                        <?php echo $form->textField($model, $attr, array('style' => 'width: 150px;')) ?>
                    </div>
                </td>
                <td>
                    <?php $attr = 'dateAppointment' ?>
                    <?php echo $form->labelEx($model, $attr) ?>
                </td>
                <td>
                    <div>
                        <?php
                        echo $form->textField($model, $attr, array(
                            'class' => 'form_datetime',
                            'style' => 'width: 134px;',
                        ))
                        ?>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <?php $attr = 'doctorName' ?>
                    <?php echo $form->labelEx($model, $attr) ?>
                </td>
                <td colspan="3">
                    <div>
                        <?php echo $form->textField($model, $attr, array('style' => 'width: 150px;')) ?>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <?php $attr = 'verifyCode' ?>
                    <?php echo $form->labelEx($model, $attr, array('style' => 'width: 160px;')) ?>
                </td>
                <td>
                    <div>
                        <?php echo $form->textField($model, $attr, array('style' => 'width: 150px;')) ?>
                    </div>
                </td>
                <td colspan="2">
                    <?php
                    //captcha
                    $this->widget('ext.mylib.widgets.Captcha.DCaptcha', array(
                        'buttonLabel'   => '',
                        'buttonType'    => '',
                        'buttonOptions' => false,
                        'clickableImage' => true,
                        'imageOptions'   => array(
                            'title' => Yii::t('msg', 'captcha_title'),
                            'style' => 'cursor:pointer;',
                        ),
                    ));
                    ?>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <small class="txtColor1"><?php echo Yii::t('msg', 'required_input') ?></small>
                </td>
            </tr>
            <tr>
                <td colspan="4" style="text-align: center; padding-top: 10px;">
                    <button class="myBtn myBtnNormal" type="button" id="btn-finish">HOÀN THÀNH</button>
                </td>
            </tr>
        </tbody>
    </table>

<?php $this->endWidget(); ?>
<div id="null" class="null"></div>

<script type="text/javascript">
$('#btn-finish').click(function(){
    $('#myForm').submit();
//    $('#btnSubmit').trigger('click');
});

$('#reset').click(function(){
    window.location = '<?php echo Yii::app()->createUrl('dfront/home/contact') ?>';
    return false;
});

<?php if (Yii::app()->user->hasState('message')) : ?>
    var params = {
        msg: '<?php echo Yii::t('msg', Yii::app()->user->getState('message')); ?>',
        title: '<?php echo Yii::t('label', 'notify') ?>'
    };
    $('#null').showAlert(params, '');
<?php
Yii::app()->user->setState('message', null);
endif;
?>
    
$(".form_datetime").datetimepicker({
    format: 'dd/mm/yyyy hh:ii',
    minuteStep: 15,
    language: 'vi',
    weekStart: 1,
    autoclose: true
});
</script>